Skip to content

status: our 100% lines that read lower get their measured % or a remark - #495

Merged
gynt merged 1 commit into
sourcehold:mainfrom
kotijekriv:fix/status-remarks-ours
Nov 25, 2026
Merged

gynt merged 1 commit into
sourcehold:mainfrom
kotijekriv:fix/status-remarks-ours

Conversation

@kotijekriv

Copy link
Copy Markdown
Contributor

Status lines only: for our functions on main whose line says 100.0% but which read lower, the measured percentage or the remark the line was missing. No code changes.

TheRedDaemon on #417 (comment 4685756025), about a match that is short only because of the declaration count: "I would prefer it then that you take it out or use the lower percentage. The declaration count is a special case, since we clearly know the mismatch reason, and even then I would prefer a remark in the status file." #417 now does that for reinitWindow (80.4% | Reimplemented, register choice only: ... (#414)). This does the same for the rest of ours on main:

Measured:

Function PR Old line New line Reason
ShareGameSeedAndMultiplayerSettingsAndStartGame (0x00480980) #415 100.0% | Reimplemented 95.9% | Reimplemented, 100% on its PR until main's header sync 603369286; since then the map index sum's two loads take the other order, a tie that moves with the declaration count (source unchanged) The map index sum DAT_MapSelectionRelativeSelected + DAT_MapSelectionScrollOffset: the original loads relative into ecx first and adds into edx; ours loads scroll first. It read 100% on #415 until main's sync 6033692 (bisected). With #415's own headers already in, that sync's only remaining change is one new enumerator in the precompiled address header (SHC_3BB0A8C1_0x005AB0F8).
UpdateUnitLossSpeechFeedback (0x0044B840) #482 100.0% | Reimplemented, identical code; the loop-end compare (past the per-enemy history) is the next global's symbol in the original, unnamed or another global in ours 95.6% | Reimplemented, identical code on its PR until main's header sync 603369286 (the loop-end compare is the next global's symbol in the original); since then the enemies' second counter sum is built in edx where the original has ecx, a tie that moves with the declaration count (source unchanged) The enemies' total over the past nine rounds (the second RelativeValueForGenie argument) is built in edx, where the original has ecx. Same instructions and operands otherwise. Bisected over main's 24 commits after #482's base: 6033692, and within it only the added address enumerator.
LaunchSinglePlayerGameUnk (0x0042C620) #466 100.0% | Reimplemented 99.4% | Reimplemented, 100% until main's header sync 48f7e946c; since then the map index sum takes the other two registers, a tie that moves with the declaration count (source unchanged) The same map index sum, now loaded into the other two registers. It read 100% on main until the 48f7e94 sync, which added one string constant to string-literals.hpp.
MenuItemActionHandler_BuildingAndStatusMenu_BuySellMenuButtonsAndHands (0x00467040) #416 100.0% | Reimplemented 93.9% | Reimplemented, register choice only: the two player-index imuls swap ecx and edx and one load and one store take edx where the original has eax, which also moves two jne displacements by a byte (#414) As #416 recorded it ("100% per #414"): the two imul ..., 0x39f4 player-index computations use ecx and edx the other way round, and one load and one store use edx where the original has eax. The store's shorter eax encoding in the original moves two jne displacements by one byte. Same instruction count, mnemonics and memory operands.
UpdateHopsFarmer (0x00552F80) #416 100.0% | Reimplemented 99.7% | Reimplemented, register choice only: the owner pushed for getBuildingThatCanStoreThisResource is loaded into eax, ecx in the original (#414) As #416 recorded it: one hunk, the owner pushed for getBuildingThatCanStoreThisResource is loaded into eax, ecx in the original. The same two instructions and memory operand.
TicksStartCounter (0x0046CF10) #311 100.0% | Reimplemented 100.0% | Reimplemented, identical code; only the LARGE_INTEGER global's type differs in its name (ntddk_32::_LARGE_INTEGER against _LARGE_INTEGER) Normalised 100%. The four lines that differ name the same LARGE_INTEGER global with its type in another namespace (ntddk_32::_LARGE_INTEGER in the original's symbol, _LARGE_INTEGER in ours).
RenderStatusMenu_Resources (0x0043FD30) #312 100.0% | Reimplemented 100.0% | Reimplemented, identical code; only names differ: the loop's end address resolves to the next symbol, and one global is named with another type Normalised 100%. The loop's end compare resolves to the next symbol on the original's side and to a bare address on ours, and one global (0x00617ED0) is named with int on one side and int [8] on the other.
RenderStatusMenu_Weapons (0x004401A0) #312 100.0% | Reimplemented 100.0% | Reimplemented, only the loop's end address resolves to the next symbol Normalised 100%. Only the loop's end compare: the next symbol on the original's side, a bare address on ours.
MenuItemActionHandler_SingleplayerMapChoice_MapTable (0x00442C30) #349 100.0% | Reimplemented 100.0% | Reimplemented, only the two loops' end addresses resolve to the next symbol Normalised 100%. Only its two loops' end compares, named as above.
SubmitMSVMapIndexAndProperties (0x00489E30) #415 100.0% | Reimplemented 100.0% | Reimplemented, only the _chkstk call target differs Normalised 100%. Its frame is 0x17a0 bytes, so it calls the stack probe; the only difference is that call's target name (call <OFFSET1> against call _chkstk), as #415 recorded.
InitBlendFilterArraysUnk (0x0044E510) #311 100.0% | Reimplemented 100.0% | Reimplemented, only the two loops' end addresses resolve to the next symbol Normalised 95.0%: its two loops' end compares are a symbol on the original's side and a bare address on ours, which the normaliser doesn't equate. Nothing else differs.
invokeDirectPlayEnumConnections (0x00487250) #322 100.0% | Reimplemented 100.0% | Reimplemented, only the pushed callback address is unnamed in the original Normalised 95.2%: the pushed callback, 0x0047D5B0, is a bare address in the original and trampoline<4707760> (the same address) in ours, as in Jake's #405 constructors. Nothing else differs.
RenderStartingGoodDisplayElement (0x00433DA0) #380 100.0% | Reimplemented 100.0% | Reimplemented, identical code; the picture table's folded address is another global's on each side Normalised 93.8%: the picture table's folded address (imh[... - 1].height, before DAT_GMImageHeaders) is named after a different neighbouring global on each side, as in #443's NewEventCondition. Nothing else differs.
MenuItemRenderFunction_NewInvasion_UnitButtons (0x004B92D0) #330 100.0% | Reimplemented 100.0% | Reimplemented, identical code; the picture table's folded address is another global's on each side Normalised 95.2%: the same folded picture table address. Nothing else differs.
MenuItemRenderFunction_TriggerInvasion_Main (0x004BBF40) #349 100.0% | Reimplemented 100.0% | Reimplemented, identical code; the picture table's folded address is another global's on each side Normalised 95.2%: the same folded picture table address. Nothing else differs.

Why no source fix for the three ties: the order of two equal-cost loads flips with what the translation unit declares. On ShareGameSeed, 2, 3, 4, 5, 7, 10 or 13 dummy struct definitions in the file give the original's code back, and 1, 6, 8 or 16 do not. Forward declarations, typedefs and enums change nothing. Every include the three files use is needed. So only dummy declarations could restore them, and the next header sync could undo that.

Checker: openshc-pr-check gives 20 ERROR and 5 CHECK, all expected for a status-only change:

Not changed here, because they are not ours (our cleanup PRs only touched them): getWidthOfText (98.9%), UpdateFireBallistaBuilding (99.6%) and migrateGameStateForMapVersion (99.8%; 100% until a header sync, as #420 predicted).

🤖 Generated with Claude Code

TheRedDaemon asked on sourcehold#417 for a lower percentage, or the function taken out, where a match is short of 100 for a
known reason, and a remark in the status file either way. For our functions on main whose line says 100.0% but which
read lower in all-on full builds of main 71b70de and d348c31 (1f87a13 changes none of their files or headers):

- three read 100% until a header sync on main moved a register tie that depends on the declaration count (source
  unchanged): ShareGameSeedAndMultiplayerSettingsAndStartGame and UpdateUnitLossSpeechFeedback (6033692),
  LaunchSinglePlayerGameUnk (48f7e94). They get the measured % and a remark that says so;
- two differ in register choice only (sourcehold#416, recorded as 100% per sourcehold#414): they get the measured % and a "register
  choice only" remark in the form sourcehold#417 uses;
- ten differ only in names (call targets, loop-end and folded addresses, a type in a resolver's name). They stay at
  100.0% under AGENTS.md's rule and get the remark their line was missing.

Status file only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gynt
gynt added this pull request to the merge queue Nov 25, 2026
Merged via the queue into sourcehold:main with commit 7efd781 Nov 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants